/**
 * 
 */
package com.radeonsys.litmus.data.converters;

import org.springframework.core.NestedRuntimeException;

/**
 * Thrown when an attempt was made to find a {@link Converter} implementation
 * for a destination type that was unknown
 * 
 * @author Ranganath Kini (ranganathkini at gmail dot com)
 * @version 1.0
 */
public class ConverterUnavailableException extends NestedRuntimeException {
	
	/**
	 * The generated serial version UID for this class
	 */
	private static final long serialVersionUID = -5819739222299709004L;
	
	/**
	 * Stores a reference of the destination class for which no converter was found
	 */
	private final Class<?> _destinationClass;

	/**
	 * @param msg
	 */
	public ConverterUnavailableException(String msg, Class<?> destinationClass) {
		super(msg);
		_destinationClass = destinationClass;
	}

	/**
	 * @param msg
	 * @param cause
	 */
	public ConverterUnavailableException(String msg, Class<?> destinationClass, Throwable cause) {
		super(msg, cause);
		_destinationClass = destinationClass;
	}

	/**
	 * Returns a reference of the destination class for which no converter was found
	 * 
	 * @return	a reference of the destination {@link Class} for which no converter was found
	 */
	public Class<?> getDestinationClass() {
		return _destinationClass;
	}
}
